import type { PageParams } from '@/api/model/pageParams';
import { request } from '@/utils/request';

const page = async (params: PageParams) => {
    return request.post({
        url: '/food/page',
        data: params,
    });
};

const insertApi = async (data: any) => {
    return request.post({
        url: '/food/insert',
        data,
    });
};

const updateApi = async (data: any) => {
    return request.post({
        url: '/food/update',
        data,
    });
};

const deleteById = async (id: string) => {
    return request.get({
        url: `/food/delete/${id}`,
    });
};

export { deleteById, insertApi, page, updateApi };
